package com.cfcc.deptone.assetbarcodemgr.app;

import android.app.Application;

import com.orhanobut.logger.CsvFormatStrategy;
import com.orhanobut.logger.DiskLogAdapter;
import com.orhanobut.logger.FormatStrategy;
import com.orhanobut.logger.Logger;
import com.squareup.leakcanary.LeakCanary;

/**
 * 装载LOG工具，内存泄漏检测工具
 * Created by Administrator on 2018/6/14.
 */

public class BarCodeScannerApp extends Application {

    @Override
    public void onCreate() {
        super.onCreate();

        FormatStrategy formatStrategy = CsvFormatStrategy.newBuilder()
                .tag("com.cfcc.asset")
                .build();

        Logger.addLogAdapter(new DiskLogAdapter(formatStrategy));

        //初始化LeakCanary
        if(LeakCanary.isInAnalyzerProcess(this)) {
            return;
        }
        LeakCanary.install(this);
    }
}
